Optimal. Leaf size=45 \[ -\frac {2 i \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3618, 65, 214}
\begin {gather*} -\frac {2 i \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d \sqrt {a+i b}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3618
Rubi steps
\begin {align*} \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx &=\frac {i \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \cot (c+d x)\right )}{d}\\ &=\frac {2 \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{b d}\\ &=-\frac {2 i \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.43, size = 70, normalized size = 1.56 \begin {gather*} -\frac {2 i \tanh ^{-1}\left (\frac {\sqrt {a+\frac {i b \left (1+e^{2 i (c+d x)}\right )}{-1+e^{2 i (c+d x)}}}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 738 vs. \(2 (36 ) = 72\).
time = 0.47, size = 739, normalized size = 16.42
method | result | size |
derivativedivides | \(\frac {\frac {-\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2} b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{3}+\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, \left (\sqrt {a^{2}+b^{2}}\, a +a^{2}+b^{2}\right )}+\frac {\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a -\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b -\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}}{d}\) | \(739\) |
default | \(\frac {\frac {-\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}+i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2} b +\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{3}+\frac {\left (-2 i \sqrt {a^{2}+b^{2}}\, a^{2}-i \sqrt {a^{2}+b^{2}}\, b^{2}-2 i a^{3}-2 i a \,b^{2}-\sqrt {a^{2}+b^{2}}\, a b -a^{2} b -b^{3}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, \left (\sqrt {a^{2}+b^{2}}\, a +a^{2}+b^{2}\right )}+\frac {\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-i \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a -\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b -\frac {\left (-i \sqrt {a^{2}+b^{2}}-i a -b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}}}{d}\) | \(739\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 159 vs. \(2 (33) = 66\).
time = 2.53, size = 159, normalized size = 3.53 \begin {gather*} \frac {1}{2} \, \sqrt {\frac {4 i}{{\left (-i \, a + b\right )} d^{2}}} \log \left (\frac {1}{2} \, {\left (i \, a - b\right )} d \sqrt {\frac {4 i}{{\left (-i \, a + b\right )} d^{2}}} + \sqrt {\frac {{\left (a + i \, b\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - a + i \, b}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right ) - \frac {1}{2} \, \sqrt {\frac {4 i}{{\left (-i \, a + b\right )} d^{2}}} \log \left (\frac {1}{2} \, {\left (-i \, a + b\right )} d \sqrt {\frac {4 i}{{\left (-i \, a + b\right )} d^{2}}} + \sqrt {\frac {{\left (a + i \, b\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - a + i \, b}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - i \left (\int \frac {i}{\sqrt {a + b \cot {\left (c + d x \right )}}}\, dx + \int \frac {\cot {\left (c + d x \right )}}{\sqrt {a + b \cot {\left (c + d x \right )}}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.40, size = 1410, normalized size = 31.33 \begin {gather*} \frac {\ln \left (1+d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,1{}\mathrm {i}\right )\,\sqrt {-\frac {1}{a\,d^2-b\,d^2\,1{}\mathrm {i}}}}{2}-\ln \left (d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}+1{}\mathrm {i}\right )\,\sqrt {-\frac {1}{4\,\left (a\,d^2-b\,d^2\,1{}\mathrm {i}\right )}}+\frac {\ln \left (-16\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}+16\,b^3\,d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}+\frac {16\,a\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{a-b\,1{}\mathrm {i}}\right )\,\sqrt {-\frac {1}{a\,d^2-b\,d^2\,1{}\mathrm {i}}}}{2}-\ln \left (16\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}+16\,b^3\,d\,\sqrt {-\frac {1}{d^2\,\left (a-b\,1{}\mathrm {i}\right )}}-\frac {16\,a\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{a-b\,1{}\mathrm {i}}\right )\,\sqrt {-\frac {1}{4\,\left (a\,d^2-b\,d^2\,1{}\mathrm {i}\right )}}-2\,\mathrm {atanh}\left (\frac {32\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}}{-\frac {64\,a\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^4\,d^2\,64{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}+\frac {a\,b^3\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,128{}\mathrm {i}}{-\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^6\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}-\frac {128\,a^2\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}}{-\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {b^6\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}\right )\,\sqrt {-\frac {a-b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}+2\,\mathrm {atanh}\left (\frac {32\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}}{\frac {64\,a\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {b^2\,16{}\mathrm {i}}{d}+\frac {a^2\,b^2\,d^2\,64{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}-\frac {128\,a^2\,b^2\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}}{\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {b^4\,64{}\mathrm {i}}{d}-\frac {a^2\,b^2\,64{}\mathrm {i}}{d}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^4\,b^2\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}+\frac {a\,b^3\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,\sqrt {-\frac {a}{4\,a^2\,d^2+4\,b^2\,d^2}+\frac {b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}}\,128{}\mathrm {i}}{\frac {256\,a^3\,b^3\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {256\,a\,b^5\,d^2}{4\,a^2\,d^3+4\,b^2\,d^3}-\frac {b^4\,64{}\mathrm {i}}{d}-\frac {a^2\,b^2\,64{}\mathrm {i}}{d}+\frac {a^2\,b^4\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}+\frac {a^4\,b^2\,d^2\,256{}\mathrm {i}}{4\,a^2\,d^3+4\,b^2\,d^3}}\right )\,\sqrt {-\frac {a-b\,1{}\mathrm {i}}{4\,a^2\,d^2+4\,b^2\,d^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________